<template>
	<view class="article_box">
		<scroll-view class="scroll-top" scroll-x="true" enable-flex='true'>
			<view  class="scroll-view-item" v-for="(item,index) in topList" :key='index'>
				{{item.name }}								
			</view>
		</scroll-view>
		
	</view>
</template>

<script>
	import api from '@/api/course.js'
	export default {
		data() {
			return {
				topList:[]
			}
		},
		methods: {
			getTitle(){
				api.getCategoryList().then((res)=>{
					this.topList=res.data
				})
			}
		},
		onLoad() {
			this.getTitle()
		}
	}
</script>

<style lang='scss'>
	
.article_box{
	padding-top:50px;
	width:max-content;
}
.scroll-top{
	display: flex;
	white-space: nowrap;
	.scroll-view-item{
		margin: 10px;
		width:100px
	}
	
}
</style>
